/*
 * $Id$
 */

package corejs.rt;

/**
 *
 * @author pengyu
 */
public class Undefined extends Primitive {
   
   public static final Undefined UNDEFINED = new Undefined();

   private Undefined() {super(Obj.prototype);}
   
   @Override
   public String toString() {
     return "undefined";
   }
   
   @Override
   public Bool toBool() {return Bool.FALSE;}
   
   // spec 9.3
   @Override
   public Number toNumber() {return Number.NaN;}
   
   @Override
   public Str toStr() {return Str.UNDEFINED; }
  
   @Override
   public boolean equals(final Primitive other) {
      return this == other || other.isNull();
   }
   
   @Override
   public Str typeof() {return Str.UNDEFINED;}
}
